package com.ct.deadlockdetetor.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ResultCode {

    // 自定义状态码

    // 操作成功
    SUCCESS                             (1000,"操作成功"),

    // 服务器内部错误, 友好提示
    ERROR                               (2000,"服务器繁忙请稍后重试"),

    // 操作失败, 但是服务器不存在异常
    FAILED                              (3000,"操作失败"),
    FAILED_UNAUTHORIZED                 (3001,"未授权"),
    FAILED_PARAMS_VALIDATE              (3002,"参数校验失败"),

    RESOURCE_INFO_IS_EMPTY              (4001, "资源参数为空"),
    RESOURCE_NOT_EXISTS                 (4002, "资源不存在"),
    RESOURCE_IS_USED                    (4003, "资源被占用"),
    RESOURCE_NOT_ENOUGH                 (4004, "请求实例过多"),

    DEAD_LOCK_EXISTS                    (5001, "存在死锁, 中断业务"),
    UNLOCK_INFO_IS_EMPTY                (5002, "解除的进程为空"),
    PROCESS_ID_ERROR                    (5003, "进程id错误");


    private final int code;
    private final String message;
}
